package com.example.demo4_sport.service.impl;

import com.example.demo4_sport.common.ResultMapUtils;
import com.example.demo4_sport.entity.SubMenu;
import com.example.demo4_sport.mapper.MenuMapper;
import com.example.demo4_sport.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MenuServiceImpl implements IMenuService {

    @Autowired
    private MenuMapper menuMapper;


    @Override
    public String getAllMenus() {

        final List<SubMenu> menus = menuMapper.getMenus();
        if (menus!=null){
            return ResultMapUtils.returnResult(menus,"1");
        }else {
            return ResultMapUtils.returnResult(null,"0");
        }
    }
}
